package com.xuetang9.Query;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @类: PhoneAccountDO
 * @描述: 电话账号实体类
 * @date: 2020/5/13
 * @author: Admin
 * @ver 1.0.0
 * @since JDK 1.8
 */
@Data
public class PhoneAccountQuery {
    /**
     * 获取验证码
     */
    public interface GetCode{};

    /**
     * 执行登录
     */
    public interface Login{};


    /**
     * 手机号
     */
    @NotBlank(message = "手机号必填！",groups = {GetCode.class,Login.class})
    @Pattern(regexp = "^1[345678]\\d{9}$",message = "请输入正确的手机号！",groups = {GetCode.class,Login.class})
    private String phone;

    /**
     * 验证码
     */
    @NotBlank(message = "请先请求验证码！",groups = {Login.class})
    private String verificationCode;

    /**
     * 服务器认证信息
     */
    @NotBlank(message = "请先请求验证码！",groups = {Login.class})
    private String information;


    @Override
    public String toString() {
        return "PhoneAccountQuery{" +
                "phone='" + phone + '\'' +
                ", verificationCode='" + verificationCode + '\'' +
                ", information='" + information + '\'' +
                '}';
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    public String getInformation() {
        return information;
    }

    public void setInformation(String information) {
        this.information = information;
    }
}
